package com.swt.gap.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.swt.gap.common.constant.CommonConstant;
import com.swt.gap.util.Email;
import com.swt.gap.util.EmailUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.lionsoul.ip2region.*;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;

/**
 * 请填写说明
 *
 * @author sx
 * @date 2020/8/27 10:46
 */
@Api(tags = "ip地址测试")
@RestController
@RequestMapping("/ip-test")
@Slf4j
public class IpTestController {

    @GetMapping("region")
    @ApiOperation(value = "测试ip转地区", notes = "测试ip转地区")
    @ApiResponses({@ApiResponse(code = 200, message = "ok")})
    public ResponseEntity<JSONArray> ipToRegion() throws DbMakerConfigException, FileNotFoundException {
        String[] ips = "1.180.16.169,1.181.102.189,1.182.205.29,1.183.248.95,1.188.222.138,1.189.60.5,1.190.14.29,1.191.90.248,1.192.27.138,1.193.72.99,1.194.130.76,1.195.209.19,1.196.3.220,1.197.46.93,1.198.235.197,1.199.178.139,1.2.184.209,1.203.66.192,1.204.24.216,1.205.134.174,1.206.81.189,1.207.48.182,1.24.117.193,1.24.250.255,1.24.70.141,1.25.0.117,1.25.110.187,1.25.220.203,1.25.45.23,1.25.58.40,1.25.75.226,1.25.80.245,1.26.199.206,1.26.208.234,1.26.90.193,1.27.197.238,1.27.206.241,1.27.36.234,1.27.48.66,1.27.50.88,1.27.62.33,1.27.81.70,1.28.136.198,1.28.208.236,1.28.48.133,1.28.88.143,1.29.190.167,1.29.252.127,1.29.46.39,1.29.72.245,1.29.92.58,1.30.141.215,1.30.212.34,1.30.7.153,1.30.87.130,1.30.96.11,1.31.0.110,1.31.192.176,1.31.229.214,1.31.39.78,1.31.72.49,1.31.87.214,1.31.96.65,1.46.224.114,1.48.240.255,1.48.48.84,1.48.50.110,1.49.206.185,1.49.34.189,1.49.42.44,1.49.60.190,1.50.124.189,1.50.216.215,1.50.66.206,1.50.73.147,1.50.80.241,1.50.97.189,1.56.184.215,1.56.247.112,1.57.116.98,1.57.211.122,1.57.33.140,1.57.47.99,1.57.7.145,1.58.100.78,1.58.241.128,1.58.30.103,1.58.75.76,1.58.85.238,1.58.90.44,1.59.125.163,1.59.23.154,1.60.112.149,1.60.212.13,1.60.85.239,1.60.96.249,1.61.119.237,1.61.21.43,1.61.32.242,1.61.53.129,1.61.72.222,1.61.97.35,1.62.11.199,1.62.234.151,1.62.40.50,1.62.58.241,1.62.72.25,1.62.95.146,1.63.105.132,1.63.246.254,1.63.31.236,1.63.47.84,1.63.57.217,1.68.103.1,1.68.2.33,1.68.3.63,1.68.40.126,1.68.55.45,1.68.61.123,1.68.70.232,1.68.85.84,1.68.97.115,1.69.217.233,1.69.99.145,1.70.14.0,1.70.206.123,1.70.34.98,1.70.82.116,1.70.96.18,1.71.137.128,1.71.208.181,1.80.147.85,1.80.2.162,1.80.38.5,1.80.42.110,1.80.81.138,1.80.99.177,1.81.128.4,1.81.25.201,1.81.35.117,1.81.88.201,1.82.19.117,1.82.38.92,1.82.48.107,1.82.50.190,1.82.97.161,1.83.1.42,1.83.2.224,1.83.30.162,1.83.55.65,1.83.75.221,1.83.81.55,1.83.93.102,1.84.15.215,1.84.25.116,1.84.30.196,1.84.47.168,1.84.6.47,1.84.82.144,1.85.154.125,1.85.237.234,1.85.4.54,1.85.70.125,1.86.0.243,1.86.11.35,1.86.237.2,1.86.37.13,1.86.41.0,1.86.56.228,1.86.6.185,1.86.7.89,1.86.93.67,1.87.168.138,1.87.228.85,1.91.92.85,1.94.184.153,10.105.2.182,10.137.184.220,10.172.129.126,10.177.226.96,10.197.211.43,10.205.251.7,10.226.194.23,10.238.1.204,10.25.111.168,10.32.38.30,10.35.2.243,10.42.72.126,10.43.142.202,100.102.17.249,100.114.202.175,100.64.27.142,100.80.97.103,100.89.52.127,101.105.117.251,101.126.137.158,101.131.178.4,101.16.58.166,101.17.30.162,101.18.33.3,101.19.55.205,101.204.37.135,101.21.136.155,101.22.13.137,101.232.182.195,101.245.229.22,101.25.3.233,101.26.119.6,101.27.152.42,101.28.156.228,101.29.28.135,101.30.57.214,101.31.145.225,101.37.152.183,101.39.228.75,101.41.192.138,101.44.100.21,101.45.59.85,101.46.175.63,101.47.138.164,101.64.40.210,101.65.88.36,101.66.42.243,101.67.215.115,101.68.226.75,101.69.107.11,101.70.94.97,101.71.38.128,101.72.186.225,101.73.250.137,101.74.159.222,101.75.204.131,101.80.146.155,101.81.186.88,101.83.203.208,101.84.172.111,101.85.203.47,101.86.170.102,101.87.56.20,101.88.89.77,101.89.190.213,101.93.57.17,102.22.91.229,103.1.31.27,103.119.130.31,103.134.199.21,103.197.105.17,103.216.42.40,103.228.209.211,103.238.35.41,103.24.207.81,103.251.99.41,103.27.26.58,103.3.136.10,103.38.43.154,103.40.223.200,103.41.164.75,103.47.48.202,103.55.240.130,103.57.12.142,103.63.154.238,103.73.164.217,103.85.144.19,103.90.150.37,103.94.20.249,103.98.241.124,106.109.33.14,106.118.249.63,106.125.79.53,106.16.177.192,106.17.248.155,106.18.187.254,106.19.208.172,106.2.228.183,106.224.149.215,106.3.194.213,106.32.188.230,106.33.49.21,106.34.96.114,106.35.94.187,106.36.161.148,106.38.133.182,106.39.151.13,106.4.89.234,106.40.246.44,106.41.43.84,106.42.38.65,106.43.220.219,106.44.31.4,106.45.250.43,106.46.201.117,106.47.119.59,106.5.42.214,106.52.220.202,106.54.218.159,106.56.231.178,106.57.66.132,106.58.192.212,106.59.117.113,106.6.12.123,106.60.47.236,106.61.118.22,106.7.133.185,106.8.122.179,106.80.192.160,106.81.230.186,106.82.78.93,106.83.103.13,106.84.13.229,106.85.244.51,106.86.62.81,106.87.6.183,106.88.9.7,106.89.181.161,106.9.119.184,106.91.203.254,106.92.125.220,107.148.218.226,110.124.58.209,110.157.131.47,110.166.138.65,110.176.212.129,110.180.12.161,110.191.132.220,110.229.66.209,110.230.167.77,110.247.232.170,110.250.107.14,110.51.2.0,110.52.3.133,110.53.17.140,110.54.243.49,110.6.249.253,110.7.218.62,110.72.70.36,110.73.157.21,110.77.3.83,110.80.162.120,110.81.185.31,110.82.94.152,110.83.48.26,110.84.195.252,110.85.66.224,110.86.155.148,110.87.15.107,110.88.207.8,110.89.19.67,110.90.235.223,111.0.247.227,111.1.162.121,111.107.180.215,111.113.164.207,111.122.222.151,111.14.71.153,111.15.152.26,111.163.202.108,111.176.156.224,111.18.50.164,111.19.67.36,111.2.140.53,111.205.14.6,111.214.33.103,111.22.58.226,111.23.221.98,111.25.220.83,111.26.80.14,111.27.25.192,111.28.158.23,111.29.130.97,111.3.119.103,111.30.252.141,111.32.76.207,111.33.253.200,111.34.134.203,111.35.56.188,111.36.202.11,111.37.123.240,111.38.48.15,111.40.102.235,111.41.241.59,111.42.130.40,111.43.198.118,111.44.230.217,111.47.84.72,111.48.95.230,111.49.73.91,111.50.35.244,111.52.33.229,111.53.88.6,111.56.22.213,111.58.26.84,111.59.32.156,111.6.74.178,111.60.4.190,111.61.112.2,111.62.214.89,111.63.23.75,111.7.186.207,111.72.54.230,111.73.28.79,111.74.10.46,111.75.228.148,111.76.161.125,111.77.118.233,111.78.139.37,111.79.178.35,111.8.250.144,111.85.110.36,111.9.30.145,112.0.181.35,112.1.169.207,112.10.94.1,112.11.7.186,112.12.130.232,112.13.62.199,112.14.57.44,112.17.241.127,112.18.158.250,112.19.143.40,112.2.197.15,112.20.104.88,112.211.0.39,112.224.132.105,112.231.192.245,112.240.26.74,112.25.29.84,112.26.78.157,112.27.198.35,112.28.160.75,112.29.132.68,112.3.226.200,112.30.136.187,112.31.100.53,112.32.126.232,112.36.48.162,112.37.114.72,112.38.50.38,112.39.135.2,112.4.242.238,112.40.177.74,112.41.37.251,112.42.95.52,112.43.19.55,112.44.165.136,112.45.174.113,112.47.139.160,112.48.36.149,112.49.252.106,112.5.224.142,112.50.27.51,112.51.186.45,112.53.236.30,112.54.203.198,112.6.111.51,112.64.68.103,112.65.61.58,112.66.12.222,112.67.97.167,112.7.44.48,112.8.61.61,112.80.10.36,112.81.141.42,112.82.164.55,112.83.138.198,112.84.139.70,112.85.162.211,112.86.153.171,112.87.207.19,112.9.110.222,112.91.76.34,112.92.207.8,112.93.95.148,112.94.96.12,112.95.229.165,112.96.181.2,112.97.49.216,112.98.220.177,112.99.150.21,113.0.188.164,113.1.187.197,113.100.248.148,113.117.189.3,113.127.61.237,113.138.22.89,113.140.99.135,113.15.143.195,113.16.113.252,113.17.103.152,113.18.255.201,113.195.156.20,113.2.190.107,113.200.107.60,113.214.196.57,113.225.96.44,113.232.189.74,113.240.58.97,113.250.231.149,113.26.5.129,113.27.51.70,113.28.104.48,113.3.220.182,113.4.201.232,113.44.96.101,113.45.61.252,113.47.135.255,113.5.13.176,113.56.47.215,113.57.183.189,113.58.53.65,113.6.126.82,113.61.61.93,113.64.248.104,113.65.192.218,113.66.118.225,113.67.178.223,113.68.152.209,113.69.40.189,113.7.155.153,113.70.211.33,113.71.248.61,113.72.40.0,113.73.17.192,113.74.168.130,113.75.242.216,113.76.132.64,113.77.81.143,113.78.135.63,113.79.169.113,113.8.223.70,113.80.225.136,113.81.108.151,113.82.128.4,113.83.65.195,113.85.253.18,113.86.251.99,113.87.129.100,113.88.153.247,113.89.40.21,113.9.146.252,113.90.235.47,113.91.145.159,113.92.223.195,113.93.59.205,113.94.81.236,113.95.154.65,113.96.67.86,113.97.33.37,113.98.116.110,113.99.200.14,114.101.185.247,114.138.28.28,114.217.129.111,114.223.110.211,114.235.125.197,114.240.18.228,114.250.138.217,114.55.124.94,114.63.201.72,114.81.254.170,114.82.7.62,114.83.226.225,114.84.89.80,114.85.144.93,114.86.104.87,114.87.165.58,114.88.32.88,114.89.242.134,114.92.225.8,114.94.70.31,114.95.92.130,114.96.187.17,114.97.139.193,114.98.185.239,114.99.173.121,115.120.192.247,115.134.25.54,115.148.97.53,115.153.163.199,115.164.87.38,115.175.49.30,115.183.173.196,115.191.60.182,115.202.213.185,115.217.77.83,115.229.137.234,115.231.126.9,115.34.216.223,115.35.199.25,115.45.117.145,115.46.140.74,115.48.31.152,115.49.219.40,115.50.196.232,115.51.38.90,115.52.102.21,115.53.115.216,115.54.137.147,115.55.210.159,115.56.39.21,115.57.155.13,115.58.203.149,115.59.52.176,115.60.126.129,115.61.174.137,115.62.144.191,115.63.126.10,115.84.90.200,115.85.241.29,116.1.15.155,116.10.236.118,116.115.63.164,116.135.28.23,116.140.161.104,116.153.38.247,116.167.104.4,116.178.235.79,116.18.24.175,116.199.71.105,116.2.223.232,116.209.248.222,116.21.235.182,116.22.148.10,116.238.186.227,116.243.168.217,116.253.192.19,116.26.184.137,116.27.214.242,116.28.12.182,116.29.246.140,116.3.73.236,116.30.223.90,116.31.200.207,116.4.12.41,116.5.184.65,116.52.89.28,116.53.131.11,116.54.55.137,116.55.141.100,116.6.139.115,116.62.119.254,116.7.97.150,116.76.123.22,116.77.75.250,116.8.67.173,116.9.87.132,116.95.75.5,116.97.105.210,117.10.207.231,117.111.13.29,117.12.128.103,117.136.91.225,117.147.81.163,117.151.90.182,117.166.20.202,117.178.143.188,117.182.8.49,117.190.233.248,117.20.117.76,117.21.111.47,117.22.29.14,117.23.164.152,117.24.125.140,117.25.106.47,117.26.51.80,117.27.98.106,117.28.194.115,117.29.67.240,117.30.218.47,117.31.213.70,117.32.218.88,117.33.55.173,117.34.138.88,117.35.105.138,117.36.202.19,117.37.104.130,117.39.217.178,117.40.60.128,117.41.141.146,117.42.31.232,117.43.83.163,117.44.162.158,117.45.61.144,117.57.41.132,117.59.82.153,117.60.33.31,117.61.240.64,117.62.3.156,117.63.25.215,117.65.51.61,117.66.185.85,117.67.131.133,117.68.13.12,117.69.36.16,117.70.246.235,117.71.135.108,117.75.19.215,117.78.29.111,117.8.182.103,117.80.80.57,117.81.247.103,117.82.190.178,117.83.4.77,117.84.231.96,117.85.141.141,117.86.143.78,117.87.192.167,117.88.239.77,117.89.36.92,117.9.18.205,117.90.3.237,117.91.29.34,117.92.130.120,117.93.139.212,117.94.146.3,117.95.84.41,118.115.65.6,118.121.104.224,118.134.84.197,118.174.180.68,118.183.129.251,118.198.245.139,118.205.221.74,118.212.200.85,118.239.8.187,118.24.123.251,118.254.123.35,118.28.98.154,118.29.207.108,118.68.117.190,118.72.148.92,118.73.121.140,118.74.231.46,118.75.236.127,118.76.100.82,118.77.44.208,118.78.248.177,118.79.145.209,118.80.22.204,118.81.228.239,118.89.149.236,119.0.223.221,119.1.63.92,119.103.235.90,119.118.124.41,119.123.128.145,119.134.242.107,119.147.145.29,119.166.70.75,119.178.101.114,119.183.197.177,119.191.79.37,119.200.95.151,119.233.236.105,119.248.154.156,119.251.184.116,119.32.73.173,119.33.28.237,119.35.6.224,119.36.22.62,119.39.248.18,119.4.253.100,119.41.227.92,119.44.61.182,119.48.253.89,119.49.189.230,119.5.152.15,119.50.245.0,119.51.225.41,119.52.64.141,119.53.200.141,119.54.27.138,119.55.55.16,119.60.137.95,119.62.124.140,119.7.26.231,119.79.195.25,119.80.54.25,119.84.229.237,119.85.162.70,119.86.152.228,119.96.122.181,119.98.228.174,119.99.208.155,120.0.233.152,120.1.116.158,120.10.134.59,120.11.251.107,120.12.47.195,120.14.144.207,120.15.216.168,120.199.161.12,120.2.24.87,120.208.208.178,120.218.212.120,120.229.169.169,120.232.182.139,120.242.127.243,120.253.21.118,120.27.230.233,120.3.69.107,120.32.55.170,120.33.194.33,120.34.191.222,120.35.1.117,120.36.54.155,120.37.103.221,120.38.58.141,120.39.34.191,120.4.68.100,120.40.33.233,120.41.158.218,120.42.128.90,120.43.121.117,120.5.74.135,120.6.37.11,120.68.229.190,120.69.24.223,120.7.81.103,120.70.212.61,120.71.129.45,120.8.4.101,120.80.40.172,120.81.189.26,120.82.65.13,120.83.224.252,120.84.207.201,120.85.127.31,120.86.177.130,120.87.44.232,120.9.57.166,121.10.21.106,121.11.76.52,121.12.147.220,121.13.107.127,121.14.142.79,121.15.144.220,121.16.66.247,121.17.15.230,121.18.227.18,121.19.215.25,121.20.77.154,121.21.133.163,121.22.124.90,121.239.100.221,121.24.219.3,121.25.119.150,121.26.215.94,121.27.157.187,121.28.195.2,121.29.163.151,121.30.169.185,121.31.246.168,121.32.153.11,121.33.113.30,121.34.32.177,121.35.97.162,121.43.174.239,121.46.233.235,121.52.221.163,121.56.39.60,121.57.98.129,121.58.19.99,121.60.50.60,121.61.244.181,121.62.45.53,121.63.89.57,121.68.36.150,121.69.12.189,121.8.239.182,121.9.186.140,122.115.230.140,122.136.215.241,122.141.132.233,122.159.190.123,122.189.96.221,122.192.13.228,122.202.144.204,122.224.11.16,122.238.179.130,122.243.146.223,122.4.30.57,122.5.61.130,122.51.184.108,122.6.75.84,122.64.156.100,122.67.24.48,122.7.209.153,122.96.40.58,122.97.178.91,123.10.164.120,123.11.209.135,123.123.149.180,123.139.81.141,123.147.248.154,123.158.108.106,123.162.216.242,123.171.52.5,123.180.221.10,123.196.145.21,123.207.100.6,123.234.179.20,123.245.215.216,123.4.97.159,123.5.178.151,123.52.35.151,123.53.112.89,123.54.23.53,123.55.171.106,123.58.106.157,123.66.144.236,123.7.47.178,123.70.241.144,123.8.5.21,123.82.184.239,123.9.189.111,123.96.15.123,123.97.227.218,124.116.218.126,124.129.70.158,124.134.3.229,124.14.215.190,124.152.205.78,124.160.212.23,124.172.152.41,124.193.77.178,124.204.53.6,124.227.5.15,124.237.68.230,124.244.5.184,124.6.132.194,124.64.19.43,124.65.8.39,124.66.47.167,124.67.19.77,124.72.20.253,124.76.204.169,124.77.77.24,124.78.98.50,124.79.172.92,124.88.139.170,124.89.111.141,124.90.52.80,124.91.67.65,124.92.161.72,124.93.197.4,124.94.136.93,124.95.120.117,125.108.30.23,125.110.79.158,125.127.219.168,125.210.223.133,125.220.160.51,125.32.240.47,125.33.181.197,125.34.237.215,125.36.186.6,125.37.191.47,125.38.136.150,125.40.210.214,125.41.185.200,125.42.133.107,125.43.86.178,125.44.187.151,125.45.235.129,125.46.133.225,125.47.18.225,125.59.55.44,125.62.6.173,125.64.201.43,125.65.24.165,125.66.27.50,125.67.96.145,125.68.163.22,125.69.44.25,125.70.191.26,125.71.190.155,125.72.58.241,125.73.186.164,125.74.252.63,125.75.66.27,125.76.133.164,125.77.71.106,125.78.92.205,125.79.24.161,125.80.147.241,125.81.178.198,125.82.85.11,125.83.95.112,125.84.184.87,125.85.195.221,125.86.92.107,125.87.29.19,125.88.188.172,125.89.31.146,125.90.140.68,125.91.189.206,125.92.90.251,125.93.224.246,125.94.190.215,125.95.123.1,126.208.153.11,129.204.35.9,129.211.26.202,129.28.152.232,130.105.21.153,132.232.73.76,134.159.115.200,134.175.216.200,139.170.124.62,139.189.219.157,139.199.14.224,139.207.67.43,139.214.246.214,139.227.220.89,14.0.236.98,14.103.174.55,14.104.207.206,14.105.104.35,14.106.183.215,14.107.86.73,14.108.164.125,14.109.215.201,14.110.229.191,14.111.4.126,14.112.229.88,14.113.143.45,14.114.174.190,14.115.105.37,14.116.192.217,14.117.149.107,14.118.60.152,14.119.185.242,14.120.101.149,14.121.245.189,14.122.128.64,14.123.193.66,14.124.73.18,14.126.227.112,14.127.80.95,14.130.38.105,14.131.198.33,14.134.160.47,14.135.217.56,14.144.162.74,14.145.233.152,14.146.95.83,14.149.211.87,14.152.94.96,14.153.203.82,14.154.176.92,14.155.89.113,14.156.97.240,14.157.112.120,14.159.89.65,14.17.78.195,14.18.187.6,14.196.14.8,14.197.163.180,14.20.37.148,14.204.0.195,14.205.140.220,14.208.217.81,14.209.41.99,14.21.99.56,14.210.19.14,14.211.255.103,14.212.243.63,14.213.219.30,14.214.13.136,14.215.37.94,14.217.78.92,14.218.144.41,14.219.220.117,14.220.241.1,14.221.175.109,14.222.100.146,14.223.183.219,14.23.111.194,14.24.28.178,14.25.146.57,14.27.42.32,14.28.166.140,14.29.193.237,14.30.163.209,140.207.23.16,140.224.79.224,140.237.75.60,140.243.19.35,140.250.127.178,140.75.168.185,144.0.180.169,144.12.178.144,144.255.149.19,144.48.211.19,144.52.149.131,146.88.203.21,148.70.94.45,150.138.181.173,150.223.17.108,150.255.226.199,153.0.7.225,153.101.3.213,153.118.97.72,153.3.114.165,153.34.55.21,153.35.212.253,153.36.106.154,153.37.139.188,153.99.199.223,154.197.38.165,154.209.23.172,154.222.2.214,156.255.124.76,157.0.154.86,157.122.168.74,157.61.112.108,161.49.177.5,162.220.51.58,163.125.92.132,163.142.44.172,163.179.54.210,163.204.7.179,171.104.174.0,171.110.183.197,171.120.118.153,171.13.191.118,171.14.192.98,171.15.106.21,171.209.79.64,171.210.251.244,171.222.117.180,171.34.218.211,171.35.100.238,171.36.160.187,171.37.46.116,171.38.76.95,171.39.225.54,171.40.170.2,171.41.17.141,171.42.129.86,171.43.70.255,171.44.136.163,171.8.243.51,171.80.153.189,171.81.151.110,171.82.226.138,171.83.36.187,171.88.190.121,171.89.60.165,171.9.149.77,171.90.61.73,171.91.122.237,171.92.152.4,171.93.158.136,171.94.195.223,171.95.61.173,172.81.237.249,175.0.11.201,175.1.111.239,175.100.8.234,175.11.211.173,175.12.172.46,175.146.239.173,175.153.170.85,175.167.154.114,175.173.73.41,175.18.165.99,175.19.54.19,175.20.49.106,175.21.216.42,175.22.170.134,175.23.178.169,175.3.66.76,175.30.229.226,175.31.231.115,175.4.99.75,175.42.171.152,175.43.97.208,175.44.78.191,175.5.169.47,175.6.77.170,175.7.49.39,175.8.8.103,175.9.181.166,176.59.128.173,180.104.131.152,180.112.69.13,180.121.154.7,180.130.10.121,180.141.214.211,180.153.219.126,180.162.63.160,180.175.71.18,180.191.157.147,180.213.69.157,180.232.114.73,180.88.82.37,180.89.21.219,180.90.40.179,180.91.180.96,180.95.195.49,180.97.145.230,182.105.41.143,182.119.75.138,182.129.44.196,182.134.26.192,182.147.37.113,182.151.213.217,182.204.163.153,182.239.90.188,182.241.19.46,182.254.227.202,182.32.29.34,182.33.178.66,182.34.37.20,182.35.66.65,182.36.237.106,182.37.89.61,182.38.108.243,182.39.240.167,182.40.249.236,182.44.247.59,182.45.205.152,182.46.0.222,182.47.186.115,182.51.86.182,182.84.161.41,182.85.213.17,182.86.163.92,182.87.147.117,182.88.141.54,182.89.72.192,182.90.248.45,182.91.11.49,182.96.92.226,182.97.168.78,182.98.26.71,182.99.59.133,183.0.142.113,183.1.253.222,183.10.200.102,183.11.70.21,183.128.194.223,183.134.214.70,183.142.205.142,183.156.20.135,183.160.80.169,183.17.51.117,183.185.139.15,183.199.153.122,183.2.123.136,183.200.172.58,183.216.26.36,183.227.6.18,183.234.223.62,183.24.165.214,183.253.68.7,183.26.173.14,183.27.155.105,183.28.7.131,183.29.159.213,183.3.190.7,183.30.176.244,183.31.66.98,183.32.131.238,183.33.166.174,183.34.102.156,183.35.194.156,183.36.80.198,183.37.159.43,183.39.142.131,183.4.43.205,183.40.220.11,183.41.31.235,183.42.52.77,183.44.79.214,183.45.252.181,183.47.14.154,183.48.31.169,183.49.253.242,183.5.173.54,183.50.97.55,183.51.43.201,183.52.199.138,183.53.189.36,183.54.233.29,183.56.115.196,183.57.241.186,183.58.247.21,183.6.0.133,183.60.156.6,183.61.6.101,183.62.159.65,183.63.213.61,183.64.171.123,183.65.30.82,183.66.211.18,183.67.61.145,183.69.208.216,183.7.253.179,183.70.11.166,183.71.220.31,183.92.251.145,183.93.232.212,183.94.189.218,183.95.249.60,188.131.177.158,188.170.76.201,192.144.145.156,193.112.246.128,2.49.19.22,202.104.47.207,202.110.40.170,202.137.132.125,202.175.50.139,202.186.225.199,202.53.146.14,202.60.135.68,202.62.112.136,202.76.63.135,202.96.133.122,202.97.194.169,202.98.137.42,202.99.84.71,203.144.74.32,203.156.206.116,203.168.27.205,203.177.152.38,203.189.215.27,203.190.109.254,203.241.183.9,203.56.252.22,203.57.39.196,203.8.24.174,203.93.166.255,210.13.75.6,210.186.152.218,210.21.122.169,210.22.52.132,210.47.7.140,210.73.72.88,210.76.43.157,211.103.110.154,211.138.116.166,211.141.176.165,211.161.248.194,211.90.77.154,211.91.139.231,211.92.137.143,211.93.99.96,211.94.225.36,211.97.131.95,212.64.27.206,218.0.187.41,218.1.187.9,218.109.205.238,218.11.27.194,218.12.181.68,218.13.21.198,218.14.91.107,218.15.26.251,218.16.175.238,218.17.37.30,218.18.76.1,218.19.153.68,218.205.55.117,218.213.202.246,218.22.120.90,218.23.210.117,218.240.132.210,218.25.99.74,218.26.55.209,218.27.205.30,218.28.194.194,218.29.170.26,218.3.172.108,218.31.11.10,218.4.80.2,218.5.167.116,218.57.26.14,218.58.178.98,218.59.130.10,218.6.152.178,218.60.179.115,218.61.176.78,218.62.64.150,218.63.56.104,218.64.30.230,218.65.91.162,218.66.181.57,218.67.235.48,218.68.229.26,218.69.166.69,218.7.40.234,218.70.218.6,218.71.225.28,218.72.90.241,218.73.250.198,218.74.213.75,218.75.211.8,218.76.106.112,218.77.59.105,218.78.34.187,218.79.15.164,218.8.177.137,218.81.185.26,218.82.95.110,218.83.43.146,218.84.157.9,218.85.30.178,218.86.99.54,218.87.16.211,218.88.11.209,218.89.132.78,218.9.41.3,218.90.96.217,218.91.92.80,218.92.137.199,218.94.33.206,218.95.205.12,218.98.53.69,219.129.234.89,219.136.45.204,219.140.211.33,219.156.37.131,219.232.77.83,219.77.90.16,219.93.21.126,220.115.172.41,220.152.244.211,220.166.153.131,220.174.33.198,220.184.243.82,220.195.67.139,220.202.152.55,220.249.162.2,220.250.27.205,221.0.128.138,221.1.117.6,221.10.198.147,221.11.61.170,221.12.52.132,221.13.63.97,221.14.167.47,221.15.114.205,221.178.125.116,221.182.82.3,221.192.179.100,221.2.174.151,221.207.37.63,221.211.87.229,221.227.37.200,221.235.194.211,221.3.87.248,221.4.204.130,221.5.214.40,221.6.168.91,221.7.90.34,221.8.197.138,221.9.231.236,222.129.56.137,222.135.73.67,222.140.138.19,222.160.131.80,222.173.249.110,222.181.222.23,222.191.173.65,222.209.6.74,222.210.137.238,222.222.132.203,222.247.86.10,222.34.47.241,222.39.0.234,222.42.243.79,222.44.174.53,222.56.5.15,222.64.121.172,222.65.233.201,222.67.195.163,222.68.24.43,222.69.250.87,222.70.4.98,222.71.211.2,222.72.167.11,222.74.86.218,222.75.179.2,222.76.107.158,222.77.241.148,222.78.59.156,222.79.213.108,222.80.205.45,222.81.219.204,222.82.176.220,222.83.79.83,222.84.30.76,222.85.133.3,222.86.209.116,222.87.187.168,222.88.254.168,222.89.40.117,222.90.13.188,222.91.198.254,222.92.178.214,222.93.243.193,222.94.36.25,222.95.218.16,223.104.27.188,223.11.120.47,223.12.209.184,223.13.139.195,223.146.89.15,223.151.4.197,223.166.106.148,223.198.45.252,223.209.161.185,223.212.9.110,223.220.19.237,223.244.78.37,223.255.127.123,223.64.156.198,223.65.248.86,223.66.150.140,223.67.35.250,223.68.240.7,223.70.200.236,223.71.84.154,223.72.73.237,223.73.160.3,223.74.131.77,223.75.234.115,223.77.127.109,223.78.237.138,223.79.177.238,223.8.84.68,223.80.75.170,223.81.134.21,223.83.177.183,223.84.215.176,223.85.169.225,223.86.184.210,223.87.207.124,223.88.221.18,223.89.209.158,223.9.14.103,223.90.155.97,223.91.141.203,223.93.34.210,223.94.101.63,223.95.45.222,223.96.197.152,223.97.161.93,223.98.64.78,223.99.164.148,27.10.65.144,27.106.154.135,27.109.115.136,27.11.43.164,27.110.192.150,27.12.160.163,27.124.146.89,27.128.230.120,27.129.197.17,27.13.188.64,27.14.3.98,27.15.97.12,27.150.199.6,27.151.166.95,27.152.211.60,27.153.166.166,27.154.68.171,27.155.139.2,27.156.26.179,27.157.53.209,27.158.47.198,27.159.250.53,27.16.174.101,27.17.98.251,27.18.242.181,27.184.6.124,27.185.1.18,27.186.207.210,27.187.108.189,27.188.250.140,27.189.46.220,27.19.25.41,27.190.9.198,27.191.240.123,27.192.13.145,27.193.89.7,27.194.57.68,27.195.100.191,27.196.225.188,27.197.100.50,27.198.82.41,27.199.186.143,27.20.106.206,27.200.41.181,27.201.35.198,27.202.207.12,27.203.185.166,27.204.142.228,27.205.1.140,27.206.93.33,27.207.202.23,27.208.132.114,27.209.10.69,27.21.168.132,27.210.211.27,27.211.72.39,27.212.166.128,27.213.137.19,27.214.16.191,27.215.224.222,27.216.67.185,27.217.22.228,27.218.205.90,27.219.105.197,27.22.183.35,27.220.239.79,27.221.102.88,27.222.122.61,27.223.253.209,27.224.106.37,27.225.25.252,27.226.13.211,27.227.126.227,27.23.194.159,27.24.43.63,27.242.105.218,27.25.127.134,27.26.238.171,27.27.225.61,27.28.43.173,27.29.222.166,27.30.5.45,27.31.18.125,27.36.89.248,27.37.158.209,27.38.254.255,27.40.122.82,27.41.184.68,27.42.89.201,27.43.178.108,27.44.42.125,27.45.212.76,27.46.39.19,27.47.193.199,27.8.148.182,27.8.22.254,27.8.48.207,27.8.51.126,27.8.60.123,27.9.162.197,27.9.215.156,27.9.4.100,27.9.50.114,27.9.67.172,27.9.75.234,27.9.81.110,27.9.97.100,27.98.252.97,31.173.87.168,36.1.200.157,36.100.37.124,36.101.16.250,36.102.210.60,36.103.231.42,36.104.173.197,36.105.237.5,36.106.78.111,36.107.88.151,36.108.31.145,36.109.84.29,36.110.98.2,36.113.128.160,36.128.143.113,36.129.80.105,36.148.42.227,36.149.15.131,36.152.65.206,36.153.141.79,36.155.11.92,36.157.97.78,36.158.22.42,36.159.138.171,36.161.52.169,36.162.176.91,36.17.124.4,36.170.97.103,36.18.48.112,36.182.43.127,36.183.144.232,36.184.174.25,36.185.93.62,36.186.166.55,36.187.222.124,36.188.53.126,36.189.84.5,36.19.7.146,36.22.6.46,36.23.187.247,36.24.242.245,36.248.142.208,36.249.111.252,36.25.31.193,36.250.199.50,36.251.188.135,36.26.116.147,36.27.163.133,36.32.41.214,36.33.151.135,36.34.162.27,36.35.34.51,36.36.124.200,36.37.232.33,36.4.106.87,36.4.219.218,36.4.32.239,36.4.44.233,36.4.5.29,36.4.6.134,36.4.76.150,36.4.82.16,36.4.94.49,36.40.235.229,36.41.157.60,36.42.71.15,36.43.91.54,36.44.143.124,36.45.21.101,36.46.197.62,36.47.161.232,36.48.105.209,36.49.157.109,36.5.161.141,36.5.255.156,36.5.30.234,36.5.48.68,36.5.51.236,36.5.65.230,36.5.78.120,36.5.81.20,36.5.96.120,36.56.1.8,36.57.142.228,36.59.191.69,36.6.134.121,36.6.209.227,36.6.32.52,36.6.47.234,36.6.8.93,36.60.159.52,36.61.175.16,36.62.28.169,36.63.153.243,36.7.196.9,36.7.26.180,36.7.38.42,36.7.49.17,36.7.54.115,36.7.79.253,36.96.70.96,36.97.80.95,36.98.109.78,36.99.94.80,39.128.116.173,39.129.248.40,39.130.83.23,39.144.34.119,39.149.228.141,39.152.209.3,39.153.169.210,39.154.7.156,39.155.51.94,39.158.141.134,39.159.28.200,39.160.168.151,39.161.206.242,39.162.153.211,39.164.179.28,39.166.112.213,39.167.15.234,39.168.159.198,39.169.175.129,39.170.153.213,39.171.211.160,39.172.248.180,39.173.42.147,39.176.71.172,39.177.104.17,39.178.245.147,39.179.51.76,39.180.74.159,39.181.173.1,39.182.151.90,39.183.137.7,39.184.27.105,39.185.123.99,39.186.16.240,39.187.251.98,39.188.215.176,39.189.249.66,39.190.220.248,39.191.201.6,39.64.93.232,39.65.190.139,39.66.138.29,39.67.23.196,39.68.236.210,39.69.0.130,39.70.168.192,39.72.74.255,39.73.196.174,39.74.26.140,39.75.229.82,39.76.91.229,39.77.105.69,39.78.122.9,39.79.211.206,39.80.169.7,39.81.183.10,39.82.127.127,39.83.155.98,39.84.120.69,39.85.25.231,39.86.146.228,39.87.189.198,39.88.21.54,39.89.192.40,39.90.126.225,39.91.16.25,42.100.131.186,42.101.40.182,42.102.245.85,42.103.146.155,42.122.40.109,42.123.123.182,42.176.132.69,42.177.140.114,42.178.176.5,42.179.38.99,42.180.33.237,42.184.109.168,42.185.35.250,42.196.182.221,42.197.36.55,42.198.60.31,42.202.112.6,42.203.184.13,42.224.204.48,42.225.127.96,42.226.126.114,42.227.124.7,42.228.224.135,42.229.11.28,42.230.165.135,42.231.56.38,42.232.34.10,42.233.210.214,42.234.19.5,42.235.134.88,42.236.176.235,42.237.112.41,42.238.52.210,42.239.8.62,42.242.221.173,42.243.221.165,42.245.203.130,42.248.63.102,42.249.44.104,42.4.147.193,42.4.208.76,42.48.163.237,42.49.80.194,42.5.161.239,42.5.201.232,42.5.59.130,42.5.75.225,42.51.180.196,42.52.217.238,42.53.21.113,42.54.14.228,42.55.234.133,42.56.12.232,42.57.77.3,42.58.91.191,42.59.207.203,42.6.121.61,42.6.201.223,42.6.35.142,42.63.84.79,42.7.19.100,42.7.231.17,42.7.31.181,42.7.5.5,42.7.6.190,42.7.71.180,42.80.160.228,42.81.160.206,42.84.53.141,42.85.19.163,42.86.18.234,42.87.230.11,42.88.115.58,42.89.23.114,42.90.24.98,42.91.238.149,42.92.184.75,42.93.198.32,42.94.181.11,42.95.209.237,43.224.52.3,43.225.208.187,43.227.137.6,43.242.180.34,43.243.16.32,43.247.230.195,43.249.136.225,43.250.201.30,45.112.47.59,45.115.246.77,45.116.152.26,45.255.126.204,45.40.201.109,47.105.133.94,47.244.99.104,47.74.155.16,47.88.221.253,47.96.234.25,47.98.226.85,47.99.118.79,49.112.55.14,49.114.136.199,49.115.216.111,49.116.61.103,49.117.240.168,49.118.232.6,49.119.245.5,49.156.32.254,49.210.144.17,49.211.152.127,49.213.26.188,49.220.45.164,49.222.59.184,49.223.207.41,49.233.160.69,49.234.197.223,49.235.96.54,49.64.224.25,49.65.110.102,49.66.22.241,49.67.219.52,49.68.33.56,49.69.246.153,49.70.16.72,49.71.116.177,49.72.89.120,49.73.246.170,49.74.25.171,49.75.54.16,49.76.221.139,49.77.210.125,49.78.73.142,49.79.91.72,49.80.253.217,49.81.153.201,49.82.86.132,49.83.11.26,49.84.146.97,49.85.36.235,49.86.87.183,49.87.247.139,49.88.68.114,49.89.50.125,49.90.185.48,49.92.148.113,49.94.36.243,49.95.197.51,58.100.64.223,58.101.206.248,58.119.156.2,58.16.228.179,58.17.57.244,58.18.66.204,58.19.85.106,58.20.224.149,58.208.59.18,58.209.33.29,58.21.202.172,58.210.93.202,58.211.12.5,58.212.31.97,58.213.109.10,58.214.153.230,58.216.67.210,58.217.0.219,58.219.176.228,58.22.114.169,58.220.220.80,58.221.127.139,58.222.37.177,58.223.136.252,58.23.121.243,58.240.73.154,58.241.92.108,58.242.118.13,58.243.254.43,58.244.146.169,58.245.184.154,58.247.243.122,58.248.119.51,58.249.82.114,58.250.24.145,58.251.8.14,58.252.17.203,58.253.37.211,58.254.69.103,58.255.203.62,58.32.2.128,58.33.252.246,58.35.32.63,58.37.145.85,58.38.74.218,58.39.247.198,58.40.29.198,58.41.200.38,58.42.146.128,58.44.142.131,58.45.10.76,58.46.40.5,58.47.174.255,58.48.91.88,58.49.38.159,58.50.213.165,58.51.99.53,58.52.253.27,58.53.32.174,58.54.88.135,58.55.148.37,58.56.54.94,58.57.17.179,58.58.183.100,58.59.186.164,58.60.152.158,58.62.33.200,58.63.130.50,58.87.92.223,59.108.32.79,59.109.117.7,59.152.39.187,59.153.241.62,59.172.113.252,59.173.162.126,59.174.67.193,59.175.127.74,59.32.157.138,59.33.29.46,59.34.84.197,59.35.112.177,59.36.142.105,59.37.57.145,59.38.62.21,59.39.151.156,59.41.23.10,59.42.200.169,59.44.237.169,59.45.115.18,59.46.74.96,59.47.36.25,59.48.94.11,59.49.33.221,59.50.44.11,59.51.28.93,59.52.82.125,59.53.226.45,59.54.101.106,59.55.37.81,59.56.133.129,59.57.154.86,59.58.139.89,59.59.34.112,59.60.137.202,59.61.42.189,59.62.250.94,59.63.75.198,59.83.201.111,60.1.143.235,60.1.209.2,60.1.36.255,60.1.65.12,60.1.81.214,60.10.194.243,60.11.55.228,60.12.155.222,60.13.166.242,60.14.105.186,60.15.211.248,60.16.98.204,60.160.255.121,60.161.41.23,60.162.205.54,60.164.222.75,60.165.228.164,60.166.104.251,60.167.77.79,60.168.236.102,60.169.82.27,60.17.101.30,60.171.110.5,60.172.82.95,60.173.143.46,60.174.169.30,60.175.98.83,60.176.62.113,60.177.27.80,60.178.219.15,60.179.218.49,60.18.26.232,60.180.35.157,60.181.100.54,60.182.136.28,60.183.255.114,60.184.110.45,60.185.99.61,60.186.7.43,60.187.175.190,60.188.44.244,60.189.31.188,60.19.135.140,60.190.94.66,60.191.170.60,60.194.48.224,60.195.68.197,60.2.185.174,60.2.209.22,60.2.31.178,60.2.40.214,60.2.98.206,60.20.113.98,60.208.233.163,60.209.197.31,60.21.179.253,60.210.174.94,60.211.78.160,60.212.74.168,60.213.224.114,60.214.115.206,60.215.192.223,60.216.135.146,60.217.159.49,60.218.209.67,60.219.39.221,60.22.25.145,60.220.128.204,60.221.111.181,60.222.99.94,60.223.133.211,60.23.133.5,60.235.6.122,60.24.130.208,60.246.247.41,60.247.109.200,60.25.121.88,60.255.179.24,60.26.31.60,60.27.205.141,60.29.132.82,60.3.122.58,60.3.74.168,60.3.84.197,60.30.153.6,60.31.137.134,60.4.190.189,60.4.223.156,60.4.9.105,60.48.194.224,60.5.147.103,60.5.21.247,60.5.37.84,60.5.48.109,60.5.54.176,60.5.97.163,60.6.186.163,60.6.214.166,60.63.132.20,60.7.0.8,60.7.108.36,60.7.217.201,60.7.3.29,60.7.40.191,60.7.51.3,60.7.76.217,60.7.82.188,60.7.92.197,60.8.170.34,60.8.22.230,60.9.186.92,60.9.71.84,61.129.51.61,61.130.202.134,61.131.161.40,61.132.170.122,61.133.28.220,61.134.137.52,61.135.169.87,61.136.222.54,61.137.141.80,61.138.221.129,61.139.231.223,61.140.250.219,61.141.139.83,61.142.105.50,61.144.106.227,61.145.70.146,61.146.0.112,61.147.107.45,61.148.243.13,61.149.2.121,61.150.11.84,61.153.72.202,61.156.120.209,61.157.66.73,61.158.208.74,61.159.101.128,61.160.30.77,61.161.218.94,61.162.200.90,61.163.36.26,61.164.138.58,61.165.37.247,61.166.35.212,61.167.167.49,61.168.142.95,61.171.163.163,61.172.210.186,61.173.237.175,61.174.50.27,61.175.122.202,61.176.185.124,61.177.32.2,61.178.110.205,61.179.207.140,61.180.76.244,61.181.236.131,61.182.51.132,61.183.77.204,61.184.85.227,61.185.116.56,61.186.6.126,61.187.242.194,61.188.94.65,61.189.107.233,61.190.50.254,61.191.200.218,61.236.219.98,61.240.236.5,61.241.166.51,61.242.58.142,61.243.47.242,61.28.108.114,61.48.156.77,61.49.108.180,61.50.248.6,61.51.62.218,61.52.46.132,61.53.233.246,61.54.4.227,61.55.156.230,61.93.18.65,62.234.74.42,92.98.83.206,93.177.80.3,94.191.69.155,96.9.66.10,96.9.86.177".split(",");

        DbConfig dbConfig = new DbConfig();
        String dbFile = "./data/ip/ip2region.db";
        DbSearcher dbSearcher = new DbSearcher(dbConfig, dbFile);
        JSONArray ja = new JSONArray();
        for (String ip : ips) {
            try {
                DataBlock result = dbSearcher.btreeSearch(ip);

                String region = result.getRegion();
                String[] regions = region.split("\\|");
                String reg = regions[3];
                if ("0".equals(reg)) {
                    reg = regions[2];
                    if ("0".equals(reg)) {
                        reg = regions[0];
                    }
                }
                JSONObject jo = new JSONObject();
                jo.put("ip", ip);
                jo.put("region", reg);
                jo.put("city", regions[3]);
                jo.put("province", regions[2]);
                jo.put("nation", regions[0]);
                ja.add(reg);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return ResponseEntity.ok(ja);
    }

}
